package com.gxa.insurance.service;

import com.gxa.insurance.exception.BusinessException;
import com.gxa.insurance.pojo.Card;
import io.swagger.models.auth.In;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @InterfaceName CardService
 * @Description 车主卡业务层处理
 * @Author Oneby
 * @Date 2022/6/7 22:06
 * @Version 1.0
 */
public interface CardService {

    /**
     * 添加车主卡
     * @param card
     * @throws Exception
     */
    void add(Card card) throws Exception;

    /**
     * 分页查询
     * @param page
     * @param size
     * @return
     * @throws Exception
     */
    Map<String,Object> selectByPage(Integer page, Integer size)throws Exception;

    /**
     * 获取所有车主卡信息
     * @return
     * @throws Exception
     */
    List<Card> selectAll() throws Exception;

    /**
     * 根据id查询(配合删除使用)
     * @param id
     * @return
     * @throws Exception
     */
    List<Card> selectById(Integer id) throws Exception;

    /**
     * 更新车主卡
     * @param card
     * @return
     * @throws Exception
     */
    Integer update(Card card) throws Exception;

    /**
     * 删除车主卡
     * @param id
     * @return
     * @throws Exception
     */
    Integer delete(Integer id) throws Exception;

    /**
     * 根据姓名或手机号查询
     * @param map
     * @return
     */
    Map<String,Object> getLikeList(Map map);


    /**
     * 根据车牌号查询
     * @param carId
     * @return
     */
    List<Card> selectByCarId(String carId) throws BusinessException;
}
